<?php

namespace Operation\Controller;
use Think\Controller;
use Think\Auth;
use Operation\Model\Menu;

class ComController extends Controller {

    public function _initialize() {
        $this->admin = Auth::getAdmin();
        if (!$this->admin) {
            $this->redirect('Login/index');
        }
        $menuData = Menu::init($this->admin['role_id']);
        $topMenu = Menu::getTopMenu($menuData);
        //$naviga = M('quick_naviga')->where(array('admin_id'=>$this->admin['admin_id'],'is_del' => '0'))->select();
        $leftMenu = Menu::get($menuData, CONTROLLER_NAME . '/' . ACTION_NAME);
        //dump($leftMenu);die;
        $this->assign('admin', $this->admin);
        $this->assign('topMenu', $topMenu);
        //$this->assign('naviga',$naviga);
        $this->assign('leftMenu', $leftMenu);
    }
    public function __destruct() {}

}
